﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Root.master" AutoEventWireup="true" CodeFile="compldoc.aspx.cs" Inherits="Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">
    <script src="../Scripts/toolbar.js" type="text/javascript"></script>
    <div class="pageLabel">
        <dx:ASPxLabel ID="lbl_page" runat="server" Text="Список наборов документов" Font-Size="Medium" Theme="iOS">
        </dx:ASPxLabel>
    </div>
    <div style="float: left; margin-left: 10px; margin-right: 10px;">
        <dx:ASPxMenu ID="mMenu" runat="server" EnableViewState="False" EncodeHtml="False" SeparatorWidth="2px" BackColor="Transparent"
            SeparatorHeight="15px" ItemSpacing="1px">
            <SeparatorBackgroundImage ImageUrl="~\Images\shared\ToolBars\Office2003\SeparatorBackground.png" />
            <ClientSideEvents ItemClick="function(s, e) { MenuItemClick(e, grid); }" />
            <Items>
                <dx:MenuItem Name="btn_Insert" Text="" ToolTip="Добавить запись" GroupName="grp_edit" BeginGroup="True">
                    <Image Url="~/Images/shared/edit_add.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_edit" Name="btn_edit" Text="" ToolTip="Редактировать запись">
                    <Image Url="~/Images/shared/edit.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_edit" Name="btn_Delete" Text="" ToolTip="Удалит запись">
                    <Image Url="~/Images/shared/editdelete.png">
                    </Image>
                </dx:MenuItem>
                <dx:MenuItem GroupName="grp_settings" Name="btn_column" Text="" ToolTip="Настройка колонок">
                    <Image Url="~/Images/shared/group.png">
                    </Image>
                </dx:MenuItem>
            </Items>
        </dx:ASPxMenu>
        <dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="dsCompletDoc" AutoGenerateColumns="False" KeyFieldName="CODE" Width="100%" OnRowInserting="grid_RowInserting">
            <Columns>
                <dx:GridViewDataTextColumn FieldName="CODE" ReadOnly="True" VisibleIndex="0" Caption="Код"
                    FixedStyle="Left" CellStyle-BackColor="#ffffd6" Width="60px" ShowInCustomizationForm="True">
                    <Settings AllowAutoFilter="False" />
                    <EditFormSettings Visible="False" />
                    <CellStyle BackColor="#CCCCCC"></CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Описание типа" FieldName="NAME" VisibleIndex="1" Width="200px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Caption="Организация" FieldName="KONTRAGENT" VisibleIndex="2">
                    <PropertiesComboBox DataSourceID="dsKontr" IncrementalFilteringMode="StartsWith" TextField="NAME" ValueField="CODE" ValueType="System.Int32">
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
            </Columns>
            <SettingsBehavior AllowFocusedRow="True" ConfirmDelete="True" EnableCustomizationWindow="true"/>
            <SettingsPager AlwaysShowPager="True">
            </SettingsPager>
            <SettingsEditing EditFormColumnCount="1" Mode="PopupEditForm" />
            <Settings ShowFilterRow="True" ShowFooter="True" />
            <SettingsPopup>
                <EditForm AllowResize="True" HorizontalAlign="Center" MinWidth="300px" Modal="True" Width="400px" />
            </SettingsPopup>
        </dx:ASPxGridView>
        <asp:EntityDataSource ID="dsCompletDoc" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="COMPLECTDOC">
        </asp:EntityDataSource>
        <asp:EntityDataSource ID="dsKontr" runat="server" AutoGenerateOrderByClause="True" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableFlattening="False" EntitySetName="KONTRAGENT" OrderBy="" Select="it.[CODE], it.[NAME]">
            <OrderByParameters>
                <asp:Parameter Name="NAME" />
            </OrderByParameters>
        </asp:EntityDataSource>
    </div>
</asp:Content>

